<template>
    <sc-table-select placeholder="---请选择---" ref="tableselect" v-model="orgcodevalue" style="width: 300px" :pageId="pageId"
        :userCode="userCode" :purviewType="purviewType" :attrList="attrList" :valueList="valueList" :queryList="queryList"
        :orderList="orderList" :table-width="640" :multiple="multiple" :queryType="queryType" selectType="org" collapse-tags
        collapse-tags-tooltip :props="props" :selectKeyValue="selectKeyValue" @change="change" @remove-tag="removeTag">
        <!-- collapse-tags
        collapse-tags-tooltip-->
        <template #header="{}">
            <el-form :inline="true">
                <el-row :gutter="5">
                    <el-col :span="5">
                        <el-input v-model="queryList.warehouseCode" placeholder="请输入编码" style="width: 125px"></el-input>
                    </el-col>
                    <el-col :span="5">
                        <el-input v-model="queryList.warehouseName" placeholder="请输入名称" style="width: 125px"></el-input>
                    </el-col>
                    <el-col :span="5">
                        <el-select v-model="queryList.status" placeholder="请选择状态" clearable :teleported="false"
                            style="width: 125px">
                            <el-option label="---请选择状态---" value />
                            <el-option label="禁用" value="0" />
                            <el-option label="启用" value="1" />
                        </el-select>
                    </el-col>
                    <el-col :span="4">
                        <el-button type="primary" @click="$refs.tableselect.getData()">查询</el-button>
                    </el-col>
                </el-row>
            </el-form>
        </template>
        <el-table-column prop="warehouseCode" label="仓库编码" width="120"></el-table-column>
        <el-table-column prop="warehouseName" label="仓库名称" width="150" show-overflow-tooltip></el-table-column>
        <el-table-column prop="address" label="地址" width="140" sortable show-overflow-tooltip></el-table-column>
        <el-table-column prop="warehouseTypeDesc" label="类型" width="140" sortable></el-table-column>
        <el-table-column prop="Remarks" label="备注" width="120" sortable show-overflow-tooltip></el-table-column>
        <el-table-column prop="statusDesc" label="状态" width="100"></el-table-column>
    </sc-table-select>
</template>

<script>
import tool from "@/utils/tool";
import bus from "@/utils/mitt";
export default {
    name: "orgselect",
    props: {
        pageId: { type: String, default: "" },
        multiple: { type: Boolean, default: true },
        userCode: { type: String, default: "super" },
        purviewType: { type: String, default: "super" },
        selectKeyValue: { type: String, default: "Code" },
    },
    data() {
        return {
            queryType: "warehouse/pages",
            hideClearBtn: true,
            attrList: {},
            valueList: {},
            queryList: {},
            params: {
                name: "demoName",
            },
            orgcodevalue: [],
            props: {
                label: "warehouseName",
                value: "warehouselId",
                keyword: "keyword",
            },
            lastOrgVal: [],
        };
    },
    computed: {},
    mounted() { },
    methods: {
        //值变化
        change(val) {
            if (Array.isArray(val)) {
                if (val.length == 0) {
                    this.$emit("fatherMethod", []);
                } else {
                    this.$emit("fatherMethod", val);
                }
            } else {
                if (val) {
                    this.$emit("fatherMethod", val);
                }
            }
        },
    },
};
</script>

<style>
.custom-org-el-select-close .el-tag__close {
    display: none !important;
}
</style>
